import { Component, OnInit } from '@angular/core';
import {Router, ActivatedRoute} from '@angular/router';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.less']
})
export class HomeComponent implements OnInit {
  private homeName: string;
  private newsId: '123';
  constructor(private router: Router, activatedRoute: ActivatedRoute) {
    activatedRoute.queryParams.subscribe(res => {
      this.homeName = res.name;
      console.log(res.name);
      console.log(this.homeName );
    });
  }

  ngOnInit() {
  }
  tab() {
    this.router.navigate([`news/${this.newsId}`]);
    // console.log(1111111);
  }
}
